//This program demonstrates the use of default function arguments.
#include <iostream>
using namespace std;
class MyClass  {
    public:
        int func1(float f,int a,int b)
        {
            return f*a*b;
        }
        int func2(float f,int a,int b) const
        {
            return f*a/b;
        }
};
int (*pFunction)(float,int,int)=NULL;//C语言的函数指针
int (MyClass::*pMemberFunction)(float,int,int)=NULL;//C++的函数指针，非静态 函数成员
int (MyClass::*pConstMemberFunction)(float,int,int) const=NULL;//C++的函 数指针，静态函数成员


int func1(float f,int a,int b)
{
    return f*a/b;
}
int func2(float f,int a,int b)
{
    return f*a*b;
}

int main()
{
    //然后我们给函数指针pFunction赋值
    pFunction=func1;
    pFunction=&func2;


    //基本调用
//    pFunction(10.0,'a' ,'b');
//    (*pFunction)(10.0,'a' ,'b');

    MyClass cls ;

//    pMemberFunction = &cls.func1;
//    pMemberFunction = func1;
    pMemberFunction = &MyClass::func1;

    int result = cls.func1(1,2,3);
    cout << result <<endl;


}